﻿#region CREDIT & LICENSE
/*******************************************
 * CREDIT: 
 * http://www.ROMPROS.com 
 * Tremendously helpful website, also would
 * like to give special thanks to:
 * 
 * Roverser - for the great effort on a c repository 
 * that most of this was ported from. http://code.google.com/p/rombot/
 * 
 * ROMeo - for the great amount of information shared
 * all across the rompros site. http://www.rompros.com/member.php?u=1901
 * 
 * 
 * LICENSE:
 *  
 * RomAPI is c# library is used to communicate directly with
 * the Runes Of Magic game client. 
 * 
 * Copyright (C) 2010  digitalxarts@gmail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *******************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

namespace RoMFramework.RomAPI
{

    /// <summary>
    /// The RoM Unit ID
    /// </summary>
	public enum RomUnitId
	{
		SIGN = 100286
	}

    /// <summary>
    /// Race
    /// </summary>
	public enum RomUnitRace
	{
		HUMAN = 0x00,
        ELF = 0x01
	}

    /// <summary>
    /// Movement Flags for RoM
    /// </summary>
	public enum RomUnitMovement
	{
		Stop = 0x00,
		Forward = 0x01,
		Backward = 0x02,
		Strafe_Right = 0x04,
		Strafe_Left = 0x08,
		Turn_Right = 0x10,
		Turn_Left = 0x20,
		Auto_Run = 0x40
	}

    /// <summary>
    /// Attackable Masks (I'm not sure how to use these)
    /// </summary>
	public enum RomUnitAttackable
	{
		PLAYER = 0x10000,
		MONSTER = 0xA0000
	}

    /// <summary>
    /// RoM Unit Type
    /// </summary>
	public enum RomUnitType
	{
		UNKNOWN = 0,
		PLAYER = 1,
		UNIT = 2,
        SIGIL = 3,
		RESOURCE = 4
	}

    /// <summary>
    /// RoM Classes
    /// </summary>
	public enum RomUnitClass
	{
		WARRIOR = 1,
		SCOUT = 2,
		ROGUE = 3,
		MAGE = 4,
		PRIEST = 5,
		KNIGHT = 6,
		WARDEN = 7,
		DRUID = 8
	}

    public static class Common
    {
        /// <summary>
        /// The RoM Window Class Name
        /// </summary>
        public const string ROM_WINDOW_CLASS_NAME = "Radiant Arcana";

        public static byte HexToByte(String HexString)
        { 
            return Convert.ToByte(HexString.Substring(0, 2), 16);
        }
        public static string UintToHex(uint value)
        {
            StringBuilder builder = new StringBuilder("0x");
            builder.Append(Convert.ToString(value, 16).PadLeft(8, '0'));
            return builder.ToString();
        }
    }
}
